package cn.tedu.spring.eg11;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Teacher {
    @Value("老王")
    private String tName;
    @Autowired
    private Student student;

    public Teacher() {
    }

    public Teacher(String tName, Student student) {
        this.tName = tName;
        this.student = student;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "tName='" + tName + '\'' +
                ", student=" + student +
                '}';
    }
}
